home *** CD-ROM | disk | FTP | other *** search
- "$ Revision: 1.0 $"
- "Copyright 1990:
- Jecel Mattos de Assumpcao Jr.
- LSI - EPSUP, Sao Paulo, SP, Brasil"
-
- "Simulator Logic Levels "
-
- "traits <simulation> resolution"
- "Algorithm for resolution between different levels"
-
- "<prototypes simulation levels> unknown"
- "21 unknown states used in the simulator"
-
- "oddballs <simulation levels> drivenHigh"
- "oddballs <simulation levels> weakHigh"
- "oddballs <simulation levels> chargeHigh"
- "oddballs <simulation levels> highImpedance"
- "oddballs <simulation levels> chargeLow"
- "oddballs <simulation levels> weaklow"
- "oddballs <simulation levels> drivenLow"
- "7 logic levels used in the simulator"
-
- traits _DefineSlots: ( |
- simulation* = ( |
- resolution = ( |
- resolve: aValue = (
- ( weakest > aValue strongest )
- ifTrue: [ self ]
- False: [
- ( strongest < aValue weakest )
- ifTrue: [ aValue ]
- False: [
- == aValue
- ifTrue: [ self ]
- False: [
- oddballs simulation levels unknown
- merge: highest
- To: lowest
- With: aValue highest
- To: aValue lowest
- ].
- ].
- ].
- ).
- | ).
- | ).
- | )
-
- prototypes _DefineSlots: ( |
- simulation* = ( |
- levels* = ( |
- unknown = ( |
- parent** = traits clonable.
- operation* = traits simulation resolution.
- lowest.
- highest.
- position = ( error: 'unknown does not have a position' ).
- == x = ( ( lowest == x lowest ) && ( highest == x highest ) ).
- unknown: v1 To: v2 = (
- v1 == v2 ifFalse: [ | c |
- c: copy.
- c lowest: v2.
- c highest: v1.
- c ]
- True: [ v1 ].
- ).
- merge: v1 To: v2 With: v3 To: v4 = ( | p1. p2. p3. p4 |
- p1: v1 position.
- p2: v2 position.
- p3: v3 position.
- p4: v4 position.
- ( p2 >= 0 ) && ( p4 >= 0 )
- ifTrue: [
- unknown: ( p1 > p3
- ifTrue: [ v1 ]
- False: [ v3 ] )
- To: ( p2 > p4
- ifTrue: [ v2 ]
- False: [ v4 ] )
- ]
- False: [
- ( p1 <= 0 ) && ( p3 <= 0 )
- ifTrue: [
- unknown: ( p1 > p3
- ifTrue: [ v3 ]
- False: [ v1 ] )
- To: ( p2 > p4
- ifTrue: [ v4 ]
- False: [ v2 ] )
- ]
- False: [
- unknown: ( p1 > p3
- ifTrue: [ v1 ]
- False: [ v3 ] )
- To: ( p2 > p4
- ifTrue: [ v4 ]
- False: [ v2 ] )
- ].
- ].
- ).
- level = ( lowest level == highest level
- ifTrue: [ lowest level ]
- False: [ 2 ].
- ).
- strength = ( lowest level max: highest level ).
- weaker = ( copy unknown: highest weaker To: lowest weaker ).
- stronger = ( copy unknown: highest stronger To: lowest stronger ).
- weakest = ( lowest strength min: highest strength ).
- strongest = ( lowest strength max: highest strength ).
- isHigh = false.
- isLow = false.
- isUnknown = true.
- isDisconnected = false.
- thisObjectPrints = true.
- printString = 'x'.
- drawOn: bitmap From: p1 To: p2 = (
- bitmap xorLine: p1 To: p2 x @ p1 y.
- bitmap xorLine: p1 x @ p2 y To: p2.
- ).
- drive = ( copy unknown: highest drive To: lowest drive ).
- not = ( drive ).
- || v = ( v level == 2 ifTrue: [ v drive ] False: [ v || self ] ).
- && v = ( v level == 2 ifTrue: [ v drive ] False: [ v && self ] ).
- | ).
- | ).
- | ).
- | )
-
- oddballs _DefineSlots: ( |
- simulation* = ( |
- levels* = ( |
- drivenHigh = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = 3.
- weaker = ( oddballs simulation levels weakHigh ).
- stronger = ( self ).
- thisObjectPrints = true.
- logic* = ( |
- level = 1.
- isHigh = true.
- isLow = false.
- isUnknown = false.
- isDisconnected = false.
- printString = 'h'.
- drawOn: bitmap From: p1 To: p2 = (
- bitmap xorLine: p1 To: p2 x @ p1 y.
- ).
- strength = ( position absoluteValue ).
- drive = ( oddballs simulation levels drivenHigh ).
- not = ( oddballs simulation levels drivenLow ).
- || v = ( drive ).
- && v = ( v drive ).
- lowest = ( self ).
- highest = ( self ).
- weakest = ( strength ).
- strongest = ( strength ).
- | ).
- | ).
- drivenLow = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = -3.
- weaker = ( oddballs simulation levels weakLow ).
- stronger = ( self ).
- thisObjectPrints = true.
- logic* = ( |
- level = 0.
- isHigh = false.
- isLow = true.
- isUnknown = false.
- isDisconnected = false.
- printString = 'l'.
- drawOn: bitmap From: p1 To: p2 = (
- bitmap xorLine: p1 x @ p2 y To: p2.
- ).
- strength = ( position absoluteValue ).
- drive = ( oddballs simulation levels drivenLow ).
- not = ( oddballs simulation levels drivenHigh ).
- || v = ( v drive).
- && v = ( drive ).
- lowest = ( self ).
- highest = ( self ).
- weakest = ( strength ).
- strongest = ( strength ).
- | ).
- | ).
- unknown = ( unknown: drivenHigh To: drivenLow
- ).
- unknown: v1 To: v2 = (
- ( v1 == v2 ) ifFalse: [
- v1 "v1 has access to the lobby"
- prototypes simulation levels unknown copy
- unknown: v1 To: v2.
- ] True: [ v1 ].
- ).
- | ).
- | ).
- | )
-
- oddballs simulation levels _DefineSlots: ( |
- weakHigh = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = 2.
- weaker = ( self ).
- stronger = ( oddballs simulation levels drivenHigh ).
- thisObjectPrints = true.
- logic* = oddballs simulation levels drivenHigh logic.
- | ).
- weakLow = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = -2.
- weaker = ( self ).
- stronger = ( oddballs simulation levels drivenLow ).
- thisObjectPrints = true.
- logic* = oddballs simulation levels drivenLow logic.
- | ).
- chargeHigh = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = 1.
- weaker = ( self ).
- stronger = ( self ).
- thisObjectPrints = true.
- logic* = oddballs simulation levels drivenHigh logic.
- | ).
- chargeLow = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- position = -1.
- weaker = ( self ).
- stronger = ( self ).
- thisObjectPrints = true.
- logic* = oddballs simulation levels drivenLow logic.
- | ).
- highImpedance = ( |
- parent** = traits oddball.
- operation* = traits simulation resolution.
- level = 0.5.
- strength = 0.
- position = 0.
- weaker = ( self ).
- stronger = ( self ).
- drive = ( oddballs simulation levels unknown ).
- isHigh = false.
- isLow = false.
- isUnknown = false.
- isDisconnected = true.
- thisObjectPrints = true.
- printString = 'z'.
- drawOn: bitmap From: p1 To: p2 = ( | y |
- y: ((p1 y) + (p2 y)) / 2.
- bitmap xorLine: p1 x @ y To: p2 x @ y.
- ).
- not = ( oddballs simulation levels unknown ).
- || v = ( oddballs simulation levels unknown ).
- && v = ( oddballs simulation levels unknown ).
- lowest = ( self ).
- highest = ( self ).
- weakest = ( strength ).
- strongest = ( strength ).
- | ).
- | )
-